package com.john.bms.utils;

import com.john.bms.model.system.user.SysUser;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

/**
 * @author 86920
 */
public class AppSecurityUtils {

    /**
     * @return
     * @获取用户信息
     */
    public static SysUser getUserInfo() {

        Subject subject = SecurityUtils.getSubject();
        if (subject == null && subject.getPrincipal() == null) {
            return null;
        }

        SysUser user = (SysUser) subject.getPrincipal();

        return user;
    }
}
